package com.aabbc.user.controller;

import com.aabbc.order.entity.OrderInfo;
import com.aabbc.order.facade.IOrderInfoFacade;
import com.aabbc.user.entity.UserInfo;
import com.aabbc.user.service.IUserInfoService;
import com.alibaba.dubbo.config.annotation.Reference;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author chenhai
 * @since 2019-11-01
 */
@RestController
@RequestMapping("/userInfo")
public class UserInfoController {

    @Autowired
    IUserInfoService userInfoService;

    @Reference(version = "1.0.0")
    IOrderInfoFacade orderInfoFacade;

    @GetMapping("/test")
    public String test(){
        return "UserInfoController.test" + System.currentTimeMillis();
    }

    @GetMapping("/list")
    public List<UserInfo> queryUserInfoList(){
        return userInfoService.list();
    }

    @GetMapping("/orderList")
    public List<OrderInfo> queryOrderInfoList(){
        return orderInfoFacade.queryOrderInfoList();
    }
}

